<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Linked extends CI_Controller {

	// 
	//  index.php
	//  www.6block.com
	//  
	//  Created by Will_Lee on 2011-05-17.
	//  Copyright 2011 lishuzu. All rights reserved.
	// 
	function __construct()
	{
		parent::__construct();
		$this->weibo_user = $this->session->userdata('weibo_user') ? $this->session->userdata('weibo_user') : '';
	}
	
	public function sina()
	{
		//sina微博登陆验证
		//sina微博
		$this->load->helper('sinaweibo/sina_weibooauth');
		$sina_login = new WeiboOAuth(SINA_WB_AKEY, SINA_WB_SKEY);
		$sina_keys = $sina_login->getRequestToken();
		$sina_authurl = $sina_login->getAuthorizeURL( $sina_keys['oauth_token'] ,TRUE , SINA_WB_CALLBACK );
		$this->session->set_userdata(array('sina_keys' => $sina_keys));
		redirect($sina_authurl);
	}
	function qq(){
		//qq微博登陆验证
		//qq微博
		$this->load->helper('qqweibo/opent');
		$qq_login = new MBOpenTOAuth( QQ_WB_AKEY , QQ_WB_SKEY );		
		$qq_keys = $qq_login->getRequestToken(QQ_WB_CALLBACK);
		$qq_authurl = $qq_login->getAuthorizeURL( $qq_keys['oauth_token'] ,false , '' );
		$this->session->set_userdata(array('qq_keys' => $qq_keys));
		redirect($qq_authurl);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/index.php */